package littlepicture.data.dao.impl;

import java.util.List;

import littlepicture.data.dao.RecordDao;
import littlepicture.data.model.WorkRecord;
import littlepicture.data.template.EmployeeDailyWork;
import littlepicture.data.template.EmployeeDate;

import com.ibatis.dao.client.DaoManager;
import com.ibatis.dao.client.template.SqlMapDaoTemplate;

public class RecordDaoImpl extends SqlMapDaoTemplate implements RecordDao{

	public RecordDaoImpl(DaoManager daoManager) {
		super(daoManager);
	}

	public void deleteRecord(long workRecordId) {
		delete("deleteRecordById",new Long(workRecordId));
	}

	public void updateRecord(WorkRecord wr) {
		update("updateRecordById", wr);
	}

	public Integer addRecord(WorkRecord wr) {
		return (Integer) insert("addWorkRecord", wr);
	}
	
	public WorkRecord getWorkRecordById(long workRecordId) {
		return (WorkRecord) queryForObject("getWorkRecordById", new Long(workRecordId));
	}

	public List<EmployeeDailyWork> getEmployeeDailyWork(EmployeeDate employeeDate) {
		return queryForList("getEmployeeDailyWork",employeeDate);
	}

}
